export function deepCopy (object: any) {
  const type = Object.prototype.toString.call(object).slice(8,-1).toLowerCase()
  if(['object','array'].includes(type)) {
    const result = type ==='object' ? {} : []
    return Object.keys(object).reduce((obj:any,attr) =>{
      const attrValue = object[attr]
      obj[attr] = deepCopy(attrValue)
      return obj
    },result)
  }
  return object
}
